#include <iostream>
using namespace std;

//HJ73 计算日期到天数转换
//https://www.nowcoder.com/practice/769d45d455fe40b385ba32f97e7bcded?tpId=37&&tqId=21296&rp=1&ru=/activity/oj&qru=/ta/huawei/question-ranking
/*
int GetMonthDay(int year, int month){
    int monthArray[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
    if(month == 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))
        return 29;
    else
        return monthArray[month];
}

int main() {
    int year, month, day = 0;
    cin >> year >> month >> day;
    int ret = day;
    --month;
    while (month){
        ret += GetMonthDay(year,month);
        --month;
    }
    cout << ret << endl;
    return 0;
}
*/

/*
int main(){
    int year, month, day;
    cin >> year >> month >> day;
    int monthday1_N[13] = {0,31,59,90,120,151,181,212,243,273,304,334,365};
    int Nday= monthday1_N[month-1];
    Nday += day;
    if(month > 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))
        Nday += 1;
    cout << Nday << endl;
}
*/

//KY111 日期差值
//https://www.nowcoder.com/practice/ccb7383c76fc48d2bbc27a2a6319631c?tpId=62&&tqId=29468&rp=1&ru=

class Data{
public:
    Data(int year = 2011, int month = 4, int day = 12){
        _year = year;
        _month = month;
        _day = day;
    }

    int GetMonthDay(int year, int month){
        int monthArray[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
        if(month == 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))
            return 29;
        else
            return monthArray[month];
    }

    Data& operator+=(int day){
        _day += day;
        while (_day > GetMonthDay(_year,_month)){
            _day -= GetMonthDay(_year,_month);
            _month++;
            if(_month == 13){
                ++_year;
                _month = 1;
            }
        }
        return *this;
    }

    Data& operator++(){
        *this += 1;
        return *this;
    }

    bool operator<(const Data& d)const{
        return _year < d._year || (_year == d._year && _month < d._month)
        || (_year == d._year && _month == d._month && _day < d._day);
    }

    bool operator==(const Data& d)const{
        return _year == d._year && _month == d._month && _day == d._day;
    }

    bool operator!=(const Data& d)const{
        return !(*this == d);
    }

    int operator-(const Data& d)const{
        Data max = *this;
        Data min = d;
        int flag = 1;
        if(*this < d){
            max = d;
            min = *this;
            flag = -1;
        }
        int n = 0;
        while (min != max){
            ++min;
            ++n;
        }
        return (n+1) * flag;
    }

//private:
    int _year;
    int _month;
    int _day;
};

int main(){
    Data d1;
    Data d2;
    while (scanf("%04d%02d%02d\n%04d%02d%02d",&d1._year,&d1._month,&d1._day,&d2._year,&d2._month,&d2._day)!=EOF){
        int ret = abs(d1 - d2);
        cout << ret << endl;
    }
    return 0;
}